<table class="table">
    <thead>
        <tr>
            <th>客服ID</th>
            <th>客服电话</th>
            <th>客服qq</th>
            <th>客服微信号</th>
            <th>操作</th>
        </tr>
    </thead> 
    <tbody>
    <?php
    	foreach($lists as $data){

    ?>
        <tr>
            <td><?php echo $data['id']?></td>
            <td><?php echo $data['tel']?></td>
            <td><?php echo $data['qq']?></td>
            <td><?php echo $data['wechat']?></td>
            <td>
            	<a href="javascript:;" data-id=<?php echo $data['id']?> class="btn btn-primary btn-xs update">修改信息</a>
            	<a href="javascript:;" data-id=<?php echo $data['id']?> class="btn btn-danger btn-xs delete">删除</a>
            </td>
        </tr>
    <?php
    	}
    ?>
    </tbody>
</table>



<script type="text/javascript">
	$(document).ready(function(){
        $('.update').click(function(){
            var sid = $(this).attr('data-id');

            showMessage('',false,'<?php echo U("Admin/Basic/CustomService/update")?>',{id:sid},1);

        });


        $('.delete').click(function(){
            var sid = $(this).attr('data-id');
            var url = '<?php echo U("Admin/Basic/CustomService/delete")?>';

            $.post(url,{id:sid},function(res){
                alert(res.msg);
                if(res.code === 200){            
                    window.location.reload();
                }

            });

        })
		

	})

</script>